﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:BrokenHouse.Windows.Parts.Transition">
    
    <Style x:Key="STYLE_AtCenter" TargetType="{x:Type local:TransitionFrame}" 
           BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
    </Style>
    
    <Style x:Key="STYLE_AtStart" TargetType="{x:Type local:TransitionFrame}" 
           BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
        <Setter Property="OpacityMask">
            <Setter.Value>
                <DrawingBrush TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,60,60" ViewportUnits="Absolute">
                    <DrawingBrush.Drawing>
                        <GeometryDrawing Brush="White">
                            <GeometryDrawing.Geometry>
                                <GeometryGroup>
                                    <RectangleGeometry Rect="1,1,0,0"/>
                                </GeometryGroup>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                    <DrawingBrush.Transform>
                        <RotateTransform Angle="45"/>
                    </DrawingBrush.Transform>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="STYLE_CenterToStart" TargetType="{x:Type local:TransitionFrame}" 
           BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
        <Setter Property="OpacityMask">
            <Setter.Value>
                <DrawingBrush TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,60,60" ViewportUnits="Absolute">
                    <DrawingBrush.Drawing>
                        <GeometryDrawing Brush="White">
                            <GeometryDrawing.Geometry>
                                <GeometryGroup>
                                    <RectangleGeometry Rect="0,0,2,2"/>
                                </GeometryGroup>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                    <DrawingBrush.Transform>
                        <RotateTransform Angle="45"/>
                    </DrawingBrush.Transform>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
    </Style>

    <Style x:Key="STYLE_CenterToEnd" TargetType="{x:Type local:TransitionFrame}" 
           BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
        <Setter Property="OpacityMask">
            <Setter.Value>
                <DrawingBrush TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,60,60" ViewportUnits="Absolute">
                    <DrawingBrush.Drawing>
                        <DrawingGroup>
                            <GeometryDrawing Brush="White">
                                <GeometryDrawing.Geometry>
                                    <GeometryGroup>
                                        <RectangleGeometry Rect="0,0,2,2"/>
                                    </GeometryGroup>
                                </GeometryDrawing.Geometry>
                            </GeometryDrawing>
                            <GeometryDrawing Brush="Black">
                                <GeometryDrawing.Geometry>
                                    <GeometryGroup>
                                        <RectangleGeometry Rect="0,0,2,2"/>
                                    </GeometryGroup>
                                </GeometryDrawing.Geometry>
                            </GeometryDrawing>
                        </DrawingGroup>
                    </DrawingBrush.Drawing>
                    <DrawingBrush.Transform>
                        <RotateTransform Angle="45"/>
                    </DrawingBrush.Transform>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
    </Style>

    <Style x:Key="STYLE_AtEnd" TargetType="{x:Type local:TransitionFrame}" BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
        <Setter Property="OpacityMask">
            <Setter.Value>
                <DrawingBrush TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,60,60" ViewportUnits="Absolute">
                    <DrawingBrush.Drawing>
                        <DrawingGroup>
                            <GeometryDrawing Brush="White">
                                <GeometryDrawing.Geometry>
                                    <GeometryGroup>
                                        <RectangleGeometry Rect="0,0,2,2"/>
                                    </GeometryGroup>
                                </GeometryDrawing.Geometry>
                            </GeometryDrawing>
                            <GeometryDrawing Brush="Black">
                                <GeometryDrawing.Geometry>
                                    <GeometryGroup>
                                        <RectangleGeometry Rect="1,1,0,0"/>
                                    </GeometryGroup>
                                </GeometryDrawing.Geometry>
                            </GeometryDrawing>
                        </DrawingGroup>
                    </DrawingBrush.Drawing>
                    <DrawingBrush.Transform>
                        <RotateTransform Angle="45"/>
                    </DrawingBrush.Transform>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Storyboard x:Key="TRANS_ToStart">
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[0].Rect" To="1,1,0,0" Duration="0:0:1" />
    </Storyboard>

    <Storyboard x:Key="TRANS_StartToCenter">
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[0].Rect" To="0,0,2,2" Duration="0:0:1" />
    </Storyboard>

    <Storyboard x:Key="TRANS_EndToCenter">
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Children[1].Geometry.Children[0].Rect" To="0,0,2,2" Duration="0:0:1" />
    </Storyboard>
    
    <Storyboard x:Key="TRANS_ToEnd">
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Children[1].Geometry.Children[0].Rect" To="1,1,0,0" Duration="0:0:1" />
    </Storyboard>
    
</ResourceDictionary>
